
#include<string.h>
int *numberOfLines(int *widths, int widthsSize, char *s, int *returnSize)
{
    *returnSize = 2;
    int *res = malloc(sizeof(int) * 2);
    res[0] = 1;
    res[1] = 0;
    int len = strlen(s);
    int start = 0;

    for (int i = 0; i < len; ++i)
    {
        if (start + widths[s[i] - 'a'] <= 100)
        {
            start += widths[s[i] - 'a'];
        }
        else
        {
            start = widths[s[i] - 'a'];
            res[0]++;
        }
        res[1] = start;
    }

    return res;
}